// w = floaty.window(
//     <frame id="action" bg="#90251911" w="200" h="200" padding="2">
//         <linear w="auto" h='auto'>
//             <vertical gravity="left" padding="-1">
//                 <button id="Bmin" text="121212" w="30" h="32" textSize="8sp" />
//                 <button id="yidong" text="M" size="11" w="30" h="32" textSize="8sp" />
//                 {/* <button id="tuichu" text="E" margin="1 1" size="11" w="30" h="32" textSize="8sp" /> */}
//             </vertical>
//             <vertical padding="0">
//                 <com.stardust.autojs.core.console.ConsoleView id="ConS" margin="1" textSize="7sp" />
//             </vertical>
//         </linear>
//     </frame>
// );

// setInterval(() => {
    
// }, 1000);

app.launch("com.yutang.app");
while(true){
    text("加速").findOne().parent().click(); 
    toastLog("进入广告");
    sleep(20000);
    var closeBtn;
    if(currentActivity() == "com.mob68.ad.VideoActivity"){
        closeBtn = id("com.yutang.app:id/cancle").visibleToUser().findOne();
    }else{
        closeBtn = id("com.yutang.app:id/tt_video_ad_close_layout").findOne();
    }
    sleep(random(1200,3000));
    toastLog(closeBtn.bounds())
    closeBtn.click();
    toastLog("退出广告");
}